<template>
    <div>
      <h2>子组件</h2>
      <p>ID: {{ id }}</p>
    </div>
  </template>
  
  <script lang="ts" >
  export default {
    name: 'ChildComponent',
    computed: {
      id() {
        return this.$route.params.id; // 获取子路由参数
      }
    }
  };
  </script>
  